package cn.tedu.knows.portal.mapper;

import cn.tedu.knows.portal.model.Question;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

/**
 * <p>
 * Mapper 接口
 * </p>
 *
 * @author tedu.cn
 * @since 2022-03-04
 */
@Repository
public interface QuestionMapper extends BaseMapper<Question> {

    @Select("select count(*) from question " +
            "where user_id=#{id} and delete_status=0")
    int countQuestionsById(Integer userId);

    @Select("select count(*) from user_collect " +
            "where user_id=#{id}")
    int countCollectionsById(Integer userId);

}
